<?php
namespace App\Scopes\Users;

use Hyperf\Database\Model\Builder;
use Hyperf\Database\Model\Model;
use Hyperf\Database\Model\Scope;

/**
 * Class Good Scope
 * @author zx
 * @package App\Scopes\Goods
 */
Class Payer implements Scope {

    public function apply(Builder $builder, Model $model)
    {
        $app = getApp();
        switch ($app) {
            case 'mini':
                $builder->whereIn('user_id', getInfo('mini', 'users'))
                    ->where('openid', getInfo('mini', 'openid'));
                break;
        }
    }

}